package com.tarena.test.lbs.basic.threadlocal.utils;
//系统通过工具类构造的 save方法存储数据 get方法取数据 remove 清空数据等等

public class NameThreadLocal {
    private static  ThreadLocal<String> THREADLOCAL = new ThreadLocal<>();

    //存储数据
    public static void save(String name){
        THREADLOCAL.set(name);
    }

    //获取数据
    public static  String get(){
        return  THREADLOCAL.get();
    }
    //清空数据 将当前线程的value删除
    public static void clear(){
        THREADLOCAL.remove();
    }
}

